package uit.com.project.iCampus.dao.hibernate;

import java.util.List;

import uit.com.project.iCampus.dao.BuildingRateDAO;
import uit.com.project.iCampus.model.BuildingInfo;
import uit.com.project.iCampus.model.BuildingRate;
import uit.com.project.iCampus.model.BuildingTypeEnum;

public class BuildingRateDAOHibernate extends GenericHibernateDAO<BuildingRate, Long> implements BuildingRateDAO{

	/**
	 * search BuildngInfo With BuildingTypeEnum
	 * 
	 * @param buildingTypeEnum
	 * @return List<BuildingInfo>
	 */
	@SuppressWarnings("unchecked")
	//@Override
	public List<BuildingInfo> searchBuildngInfoWithBuildingTypeEnum(
			BuildingTypeEnum buildingTypeEnum) {
		return getSession()
				.createQuery(
						"FROM BuildingInfo AS BldInfo WHERE BldInfo.buidingTypeEnum = :buidingTypeEnum")
				.setParameter("buidingTypeEnum", buildingTypeEnum)
				.list();
	}
	
}